import { request2, request3 } from './request'

export function getSpecificAddress(coordinate) {
  return request2({
    url: '/pois/' + coordinate
  })
}

export function getSwiper(geohash) {
  const flags = ['F']
  return request2({
    url: '/index_entry',
    params: {
      geohash,
      group_type: 1,
      flags
    }
  })
}


export function getRestaurants(latitude, longitude) {
  // 这些参数都是可有可无的,可以不写
  const extras = ['activities']
  let keyword = ''
  let restaurant_category_id = ''
  const restaurant_category_ids = []
  let order_by = ''
  const delivery_mode = []
  return request3({
    url: '/restaurants',
    params: {
      latitude: latitude,
      longitude: longitude,
      offset: 0,
      limit: 20,
      extras,
      keyword,
      restaurant_category_id,
      restaurant_category_ids,
      order_by,
      delivery_mode
    }
  })
}